
#include "client.h"
#include <string>
#include <iostream>

int main(int argc, char* argv[])
{
    #ifdef DEBUG

        std::cout<<"[DEBUG]\n";
        #if defined(_MSC_VER) || defined(__MINGW__) || defined(__MINGW32__)
            std::string filename = "client-32-d.exe";
        #else
            std::string filename = "client.exe;
        #endif
    #else
        std::cout<<"[RELEASE]\n";
        #if defined(_MSC_VER) || defined(__MINGW__) || defined(__MINGW32__)
            std::string filename = "client.exe";
        #else
            std::string filename = "client;
        #endif
    #endif // DEBUG

    std::cout<<"WELCOME TO CLIENT\n";

    if(argc<3)
        std::cout << "syntaxis: 127.0.0.1 333\n"
            << "syntaxis: 127.0.0.1 333 filename.txt\n", 
            void();

    std::string addr = "127.0.0.1";
    if(argc>1)
        addr = argv[1];

    std::string port = "333";
    if(argc>2)
        port = argv[2];

    if(argc == 4)
        filename = argv[3];


    Client client;

    std::cout<<"CLIENT: STARTED\n";

    client.Start(addr, port, filename.c_str());

    std::cout<<"CLIENT: FINISHED\n";

    system("PAUSE");
}

